I would like to know if a 6502 assembler for modern Unix systems supports multiple ORG requests, so that I can force certain routines at fixed addresses, and insert 0's to fill any space. For example:
org $300
jsr rout320
rts
org $320
rout320
rts
And this will place the JSR and RTS at $300-303, and then 00's and then place an RTS at $320. I want the final binary result to be:
20 20 03 60,00 00 00 00,00 00 00 00,00 00 00 00,60
and be exactly 33 bytes. If I make an ORG request which cannot work (say, replace the "org $320" with "org $303", which already contains the previous RTS) I will accept either a warning or an error, but it cannot be silent.
I'm willing to accept alternative syntax using DS notation:
org $300
jsr rout320
rts
ds $320-*
rout320
rts
where DS means insert $320-current_pc number of 00 bytes. I just need this to be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
Kent
I would like to know if a 6502 assembler for modern Unix systems supports multiple ORG requests, so that I can force certain routines at fixed addresses, and insert 0's to fill any space. For example:
org $300
jsr rout320
rts
org $320
rout320
rts
And this will place the JSR and RTS at $300-303, and then 00's and then place
an RTS at $320. I want the final binary result to be:
20 20 03 60,00 00 00 00,00 00 00 00,00 00 00 00,60
and be exactly 33 bytes. If I make an ORG request which cannot work (say, replace the "org $320" with "org $303", which already contains the previous RTS) I will accept either a warning or an error, but it cannot be silent.
I'm willing to accept alternative syntax using DS notation:
org $300
jsr rout320
rts
ds $320-*
rout320
rts
where DS means insert $320-current_pc number of 00 bytes. I just need this to
be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
I would like to know if a 6502 assembler for modern Unix systems supports multiple ORG requests, so that I can force certain routines at fixed addresses, and insert 0's to fill any space. For example:
org $300
jsr rout320
rts
org $320
rout320
rts
And this will place the JSR and RTS at $300-303, and then 00's and then place an RTS at $320. I want the final binary result to be:
20 20 03 60,00 00 00 00,00 00 00 00,00 00 00 00,60
and be exactly 33 bytes. If I make an ORG request which cannot work (say, replace the "org $320" with "org $303", which already contains the previous RTS) I will accept either a warning or an error, but it cannot be silent.
I'm willing to accept alternative syntax using DS notation:
org $300
jsr rout320
rts
ds $320-*
rout320
rts
where DS means insert $320-current_pc number of 00 bytes. I just need this to
be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
Kent
[...]
So, does your favorite 6502 assembler support the above?
I would like to know if a 6502 assembler for modern Unix systems supports multiple ORG requests, so that I can force certain routines at fixed addresses, and insert 0's to fill any space. For example:
org $300
jsr rout320
rts
org $320
rout320
rts
I'm willing to accept alternative syntax using DS notation:
where DS means insert $320-current_pc number of 00 bytes. I just need this to be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
ACME can do something like that, though not using the "ORG" syntax.
Instead, it uses the current address via "*", so
*=$300
...
*=$320
...
etc.
and it will zero-fill in between (and also complain if you have too much
code and already occupy the requested address).
Kent Dickey <kegs@provalid.com> wrote:[ snip ]
I would like to know if a 6502 assembler for modern Unix systems supports
multiple ORG requests, so that I can force certain routines at fixed
addresses, and insert 0's to fill any space. For example:
I'm willing to accept alternative syntax using DS notation:
org $300
jsr rout320
rts
ds $320-*
rout320
rts
where DS means insert $320-current_pc number of 00 bytes. I just need this to
be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
Kent
Hi, Kent!
Merlin is capable of doing what you want in the second way.
If you want error checking in case the location counter has passed the >desired address, use a macro to issue an “err */$320”, where, for >generality, $320 is replaced by ]1, or the first parameter of the macro.
So:
morg mac ; Org with zero-fill
err */]1 ; Error if past location
ds ]1-*
eom
This assumes that it doesn’t matter what the ds does as long as the error >is flagged. Alternatively, you can use the “if” conditional assembly >construct to bracket the ds.
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Also, Merlin32 has a bug where it core dumps on the following:
org $300
jmp $fded
ds $302 - *
jmp $300
The ds being effectively -1 causes the core dump
I would like to know if a 6502 assembler for modern Unix systems supports >multiple ORG requests, so that I can force certain routines at fixed >addresses, and insert 0's to fill any space. For example:
org $300
jsr rout320
rts
org $320
rout320
rts
And this will place the JSR and RTS at $300-303, and then 00's and then place >an RTS at $320. I want the final binary result to be:
20 20 03 60,00 00 00 00,00 00 00 00,00 00 00 00,60
and be exactly 33 bytes. If I make an ORG request which cannot work (say, >replace the "org $320" with "org $303", which already contains the previous >RTS) I will accept either a warning or an error, but it cannot be silent.
I'm willing to accept alternative syntax using DS notation:
org $300
jsr rout320
rts
ds $320-*
rout320
rts
where DS means insert $320-current_pc number of 00 bytes. I just need this to >be an error if it overflows, and not 65535 blanks instead.
So, does your favorite 6502 assembler support the above?
On Friday, March 19, 2021 at 12:37:03 PM UTC-7, Kent Dickey wrote:
Also, Merlin32 has a bug where it core dumps on the following:
org $300
jmp $fded
ds $302 - *
jmp $300
The ds being effectively -1 causes the core dumpHmm, strange. I get no crash but I don't see the binary or the listing file either. It stops after:
o Build Object Code...
And doesn't get to the Link stage.
o Build Object Code...
+ Link project files...
Guess we should ping Antoinne and/or Olivier in a new thread.
m.
On Friday, March 19, 2021 at 9:19:08 PM UTC+1, michael....@gmail.com wrote:
On Friday, March 19, 2021 at 12:37:03 PM UTC-7, Kent Dickey wrote:
Also, Merlin32 has a bug where it core dumps on the following:Hmm, strange. I get no crash but I don't see the binary or the listing
org $300
jmp $fded
ds $302 - *
jmp $300
The ds being effectively -1 causes the core dump
file either. It stops after:
o Build Object Code...
And doesn't get to the Link stage.
o Build Object Code...
+ Link project files...
Guess we should ping Antoinne and/or Olivier in a new thread.
m.
Hi There,
This is what I have on my mac:
./Merlin32 -V Library/ sources/test/ds.s
./Merlin32 v1.0 64-bit universal, (c) Brutal Deluxe 2011-2021
+ Assemble project files...
o Loading Sources files...
- ds.s
o Loading Macro files...
o Check for duplicated Macros...
o Decoding lines types...
o Process local/variable Labels...
o Process Asterisk lines...
o Build External table...
o Build Equivalence table...
o Build Variable table...
o Process Equivalence values...
o Replace Macros with Code...
o Replace Lup with code...
o Process MX directives...
o Process Conditional directives...
o Build Label table...
o Check for duplicated Labels...
o Check for unknown Source lines...
o Check for Dum lines...
o Compute Operand Code size...
o Compute Operand Data size...
o Compute Line address...
=> [Error] Error : Evaluation of DS data size ends up as negative
value (-1) : '$302-ozunid_1' (line 7, file 'ds.s').
=> Creating Output file 'sources/test/error_output.txt'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (3 / 13) |
Uptime: | 50:17:27 |
Calls: | 6,649 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,330,205 |