Image Map Image Map
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: MACRO 11 Cross assembler

  1. #1

    Default MACRO 11 Cross assembler

    Hi,

    I downloaded Macro11 cross : here
    and make a very simple program

    Code:
    .TITLE TEST.MAC VERSION 1
    
    FIRST: MOV R1,1000
    	  INC R1
    	  MOV R2,1000
    	  ADD R2,R1
          HALT
    
     .END
    Using Macro11.exe I can obtain a test.obj (106 bytes). Then, using Pdp11GUI , I uploaded it into memory.
    Using dissambler tool, I checked the memory , but I didn't see something similar to the source code. For more info , Macro11 didn't get out any errors , I can hav a listing of this very small program.

    Where is my mistake ?.

    My objective is to build some programs without any OS. (Tools, specific diag etc)...Is it possible with Macro11 cross ?

  2. #2

    Default

    Having never used this cross-assembler this is just a guess. Normally assembly is "compiled" or assembled into an obj files.
    This is then often (at least from when I used assembler long ago) then linked into an executable. Maybe you need to do the
    linking? This allows multiple obj files or pieces to be put into one executable.

  3. #3
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    823
    Blog Entries
    4

    Default

    Quote Originally Posted by Activmaker View Post
    Hi,

    I downloaded Macro11 cross : here
    and make a very simple program

    Code:
    .TITLE TEST.MAC VERSION 1
    
    FIRST: MOV R1,1000
    	  INC R1
    	  MOV R2,1000
    	  ADD R2,R1
          HALT
    
     .END
    Using Macro11.exe I can obtain a test.obj (106 bytes). Then, using Pdp11GUI , I uploaded it into memory.
    Using dissambler tool, I checked the memory , but I didn't see something similar to the source code. For more info , Macro11 didn't get out any errors , I can hav a listing of this very small program.

    Where is my mistake ?.

    My objective is to build some programs without any OS. (Tools, specific diag etc)...Is it possible with Macro11 cross ?
    That produces a relocatable code segment with no fixed load address. PDP11GUI might load that at 0. Maybe not.

    I would add:
    Code:
            .asect
            .=200
    between the TITLE line and the label FIRST. Your code will then be put in an absolute section and will load at address 200.

    Don

  4. #4
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    823
    Blog Entries
    4

    Default

    Addendum (since we still can't go back and edit previous posts):

    Using the .ASECT directive is how most/all of the DEC standalone diagnostics (ie, no OS) were built. If you look at the listings you will see this.

  5. #5
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    823
    Blog Entries
    4

    Default

    More FYI. I wrote my own 'linker' when I used MACRO11 to assemble PDP-11 boot prom sources to .hex files.

    Eg, here: https://www.ak6dn.com/PDP-11/ DIAGNOSTICS for my test programs, M9312 for DEC boot proms.

    Available here: https://github.com/AK6DN/obj2bin It is a perl program.

    Here is the Makefile I use to assemble my PDP-11 diagnostic programs (.mac macro11 source files) to .obj files and then multiple .obj files to .bin files for loading.

    Code:
    # makefile for pdp11 bin code
    
    .PRECIOUS: %.obj
    
    MACOPT ?= -d md -d me -e bex -yus
    OBJOPT ?= --debug --verbose
    DMPOPT ?= no
    BEXOPT ?= yes
    
    %.obj : %.mac
    	@echo
    	macro11 $< $(MACOPT) -l $*.lst -o $@
    	@-perl -i -n -e 'print unless m/^\s*\d+\s+.nlist\s*$$/i;' $*.lst
    ifeq ($(BEXOPT),no)
    	@-perl -i -n -e 'print unless m/^\s+([0-7]{6})\s+(([0-7]{3}|[0-7]{6})\s+)+$$/i;' $*.lst
    endif
    	@-rm -f $*.lst.bak
    ifeq ($(DMPOPT),yes)
    	dumpobj $@ > $*.dmp
    endif
    
    %.bin : %.obj
    	obj2bin.pl $(OBJOPT) --binary --log $(@:.bin=.log) --out $@ $+
    
    # the end

  6. #6
    Join Date
    Jun 2012
    Location
    UK - Worcester
    Posts
    3,337

    Default

    I use macro11 and Don’s Perl script and they seem to work fine.

    I will post my shell script for you later on.

    I have made a minor tweak to Don’s Perl script to output a .bin file for programming large ROMs for embedded systems.

    Dave

  7. #7

    Default

    Thanks a lot guys. Using Don's script, it is working. I am not a specialist in perl, but it seems that the obj store Opcode in records with other informations. The script extract opcodes and absolute address to build the bin file.
    @dave,I should also learn a lot of thing with your script, thanks

  8. #8
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    823
    Blog Entries
    4

    Default

    Quote Originally Posted by Activmaker View Post
    Thanks a lot guys. Using Don's script, it is working. I am not a specialist in perl, but it seems that the obj store Opcode in records with other informations. The script extract opcodes and absolute address to build the bin file.
    @dave,I should also learn a lot of thing with your script, thanks
    The DEC object file format .obj is based on relocation records that can be very simple 'place these bytes at these addresses' to medium simple 'place these bytes at the next free address' to very complex relocation instructions on memory words 'insert this computed symbol value at word x'.

    Macro11 won't be generating most of these (usually if you use .ASECT there are just a bunch of data records to place at absolute addresses).

    I based my coding of the program on the info in 'AA-PD6PA-TC_RT-11_Volume_and_File_Formats_Manual_Aug91.pdf' for RT11v5.6 available on bitsavers.

  9. #9
    Join Date
    Jun 2012
    Location
    UK - Worcester
    Posts
    3,337

    Default

    Sorry,

    I had to work late tonight.

    I will post them tomorrow if that is OK.

    Dave

  10. #10

    Default

    @Dave take your time, I can wait.
    @Don interesting, I will have a look on the pdf.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •