machine language code

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

mlynn1974
Captain Atari
Captain Atari
Posts: 206
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: machine language code

Postby mlynn1974 » Tue Aug 14, 2018 11:10 pm

Hi Charles,
Can't you use PEEK\POKE, DPEEK\DPOKE and LPEEK\LPOKE to read unsigned bytes, words and long words?

It has been 20+ years since I wrote anything in GFA but a quick test works:
DPOKE &H78000,&HB03C
PRINT DPEEK(&H78000)

In the C programming language unsigned words are also known as unsigned shorts.

Regards,
Michael.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

rockyone
Captain Atari
Captain Atari
Posts: 442
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Re: machine language code

Postby rockyone » Tue Aug 14, 2018 11:14 pm

&HB03C ? You have changed value ! what is hex or decimal

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Tue Aug 14, 2018 11:20 pm

heres what im trying ,,
I could do it it I break the data lines into byte and stored in a byte array
but then reading it from a human perspective is made more difficult
so id like to keep it a word array

Code: Select all

' sof
'
SAVE "a:\mach.gfa"
LIST "d:\mach.lst"
WHILE EXIST("A:\*.BAK")
  KILL "a:\*.BAK"
WEND
'
RESERVE (2000 DIV 256)*256
'
DIM a&(200)
'
RESTORE wordbytevec
FOR x|=0 TO 255
  READ a%
  '  a&(x|)=(a%) AND &X1111111111111111
  '  a&(x|)=CARD(a%)
  a&(x|)=WORD(a%)
  EXIT IF a&(x|)=&H4E75
NEXT x|
'
PRINT HEX$(a&(0))
'
RESERVE
'
END
'
wordbytevec:
DATA &HB03C
DATA &H4E75


The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Tue Aug 14, 2018 11:28 pm

is now a good time to ask?
will a routine still execute if lines of $0000 consume the lower or upper half of a data line?
...so I read everything into an array of long integer?
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Tue Aug 14, 2018 11:35 pm

rocky in gfa &HB03C is hexadecimal
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Tue Aug 14, 2018 11:37 pm

rockyone
I did not look in the GFA command.
but I guess you have:
A% = LOW ($B03C)
PRINT A% and $FFFF, $BO3C, "It's magic !!" ' :mrgreen:


but it wont store in a gfa a& word array as &HB03C
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

rockyone
Captain Atari
Captain Atari
Posts: 442
Joined: Thu Jan 20, 2011 8:47 pm
Location: France
Contact:

Re: machine language code

Postby rockyone » Tue Aug 14, 2018 11:41 pm

Why do not you directly load the assembled code into a memory block ?

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Wed Aug 15, 2018 12:02 am

I can do that ,
as a inline

or
load to a malloc block,,->same as mem block in omikron
or to
array

but as I need to
I like to add modify and change the existing machine data ...

also don't like the load up ,,enjoy kknowing its hard coded

kinda irritates me that gfa is very flexable ..and allows many different ways to exchange datas
however limits its variable types so a two byte integer isn't word unsigned
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2397
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: machine language code

Postby charles » Wed Aug 15, 2018 1:17 am

sorry about all this , false alarm

it does still work but just prints a different value ...im so exhausted ,,thanks for all help

two bytes is..... just two bytes .

must have had some memory issues once I cold reset the st it began working as intended

ive replaced the midi vector (mvecsys%) with a custom routine to ignore more than #247($F7)
cool or what
?????
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests