sporniket / ideas

My backlog of ideas, organized as a bunch of issues
0 stars 0 forks source link

[IsaMc68k] Prototype an assembler suite #44

Open sporniket opened 2 months ago

sporniket commented 2 months ago

Incubation in progress : https://github.com/sporniket/python-sandbox/tree/main/py-isa-m68k

Step 1 -- Compile and generate a minimal program for Atari ST

The smallest valid program (*.PRG file) is a call to the GEMDOS function Pterm0

                move.w  #0,-(sp) ; Offset 0
                trap    #1      ; GEMDOS

Save this program in to a file named justquit.s.

TO BE DEFINED -- command line interface

Step 1.a -- compile the two lines of code

When invoking m68k_as justquit.s

Then the resulting a.out MUST be the same as compiling the program with vasm with the command : vasmm68k_mot -Fbin justquit.s.

0b0011.111.100.111.100 0b0000.0000.0000.0000    $3F3C $0000     ; move #0,-(sp) 
0b0100.111.001.000.001                          $4E41           ; trap #1

This step requires :

Step 1.b -- generate an executable program

See The program format.

When invoking m68k_as --output justquit.prg --target-format tos justquit.s

Then the resulting file justquit.prg MUST be the same as compiling the program with vasm with the command : vasmm68k_mot -Ftos -o justquit.tos justquit.s