Jump to content
IGNORED

MADS assembler, why no .DBYTE?


Atari_Ace
 Share

Recommended Posts

I've been reconstructing DOS 1.0 source code from DOS 2.0 and a disassembly, and running the result through MADS assembler to validate the binary is correct. In one place, the DOS 2.0 source code uses big-endian 16-bit integers, e.g.

 

.DBYTE XRENAME-1

 

which I can simulate in MADS via

 

.BYTE >(XRENAME-1),<(XRENAME-1)

 

but I was expecting it would be there like .WORD, since MAC/65 supports .DBYTE and already supports big-endian 32-bit integers.

 

The code does support big endian 32-bit (via format 'R'), so this is a curious omission.

 

BTW, MADS is overall an awesome assembler, which accepts syntax close enough to the various Atari assemblers that I can use it with only minor adjustments. Just providing some feedback to hopefully make it even more useful.

 

 

 

  • Like 2
Link to comment
Share on other sites

Strange... the DTA directive allows type g which is double-word (32-bit) in big endian order but no provision for 16-bit words in big-endian order.

 

It might be easiest to just create a Macro which does the work for you rather than having the annoyance of doing .BYTE >(label),<(label)

Link to comment
Share on other sites

Mad-Assembler, 32-bit:

 

.DWORD

 

dta f(xxxx)

 

dta r(xxxx) ; reverse 32bit

 

 

p.s.

Mad-Pascal, 32bit: CARDINAL, INTEGER

 

p.s. #2 ATASM instruction

 

.DBYTE <words>
Stores words in memory at the current memory address in MSB/LSB format.
Ex:
.DBYTE $1234,-1,1
will generate:
12 34 FF FF 00 01
.WORD <words>
Stores words in memory at the current memory address in native format
(LSB/MSB).
p.s. #3
probably I did not understand this .DBYTE and I created .DB (simple .BYTE)
Edited by tebe
  • Like 1
Link to comment
Share on other sites

Strange... the DTA directive allows type g which is double-word (32-bit) in big endian order but no provision for 16-bit words in big-endian order.

 

It might be easiest to just create a Macro which does the work for you rather than having the annoyance of doing .BYTE >(label),<(label)

Forgive the dumb question, but why would you do something big-endian on the 6502?

Link to comment
Share on other sites

Thanks tebe,

 

As for why .DBYTE, in DOS.SYS, it's used to implement a jump table compactly using RTS, i.e.

 

ASL A
TAY

LDA DVDCVT,Y
PHA ;PUSH EXECUTION ADDR
LDA DVDCVT+1,Y
PHA
RTS​

 

It could have used .WORD and switched the LDA lines, but arguably this is more natural.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...