Atari_Ace Posted March 27, 2016 Share Posted March 27, 2016 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. 2 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 28, 2016 Share Posted March 28, 2016 but there is a .word? Quote Link to comment Share on other sites More sharing options...
Atari_Ace Posted March 28, 2016 Author Share Posted March 28, 2016 .WORD is little endian Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 28, 2016 Share Posted March 28, 2016 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) Quote Link to comment Share on other sites More sharing options...
tebe Posted March 28, 2016 Share Posted March 28, 2016 (edited) 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 March 28, 2016 by tebe 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted March 28, 2016 Share Posted March 28, 2016 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? Quote Link to comment Share on other sites More sharing options...
tebe Posted March 29, 2016 Share Posted March 29, 2016 MADS (2.0.4 b7) + .DBYTE mads_dbyte.zip 2 Quote Link to comment Share on other sites More sharing options...
Atari_Ace Posted March 29, 2016 Author Share Posted March 29, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.