LF: Still: fargo programming


[Prev][Next][Index][Thread]

LF: Still: fargo programming



I don' t understand: i hadn' t been thinking much in my last email: what i
had done was stupid....
Howerver: here is what i don' t understand: i want to disp a message on the
screen: i don' t want to use a macro ( it is some sort of exercise ) . 
Here is a hello world prog. I would like to write a subroutine which disp a
message  and wich uses the adress of the param as in param. Thus , i wrote
the 2nd prog. ( see and of message ) What is wrong with it ? 

             @Program          prog_code,prog_name


prog_code:

    jsr flib[clr_scr]


main:
    move.w   #4,-(A7)
    pea      ess(PC)
    move.w   #10,-(A7)
    move.w   #10,-(A7)
    jsr      romlib[puttext]
    lea      10(A7),A7
    jsr      flib[idle_loop]
    rts

ess: dc.b "coucou",0

prog_name:
  dc.b "essai",0

         reloc_open
         add_library romlib
         add_library flib
         reloc_close
         end


2nd prog: 

            @Program          prog_code,prog_name


prog_code:

    jsr flib[clr_scr]

main:
    pea      ess        ; Loads "ess" adress in the stack
    bsr      affich
    rts
    
affich:
    move.l   D7,A1      ; gets back the param in A1
    lea      4(A7),A7   ; puts the stack back to normal
    move.w   #4,-(A7)   ;
    pea      D7(PC)     ;    loading params for puttext  
    move.w   #10,-(A7)  ;    
    move.w   #10,-(A7)  ;
    jsr      romlib[puttext]
    lea      10(A7),A7
    rts


ess: dc.b "coucou",0

prog_name:
  dc.b "essai",0

         reloc_open
         add_library romlib
         add_library flib
         reloc_close
         end


Follow-Ups: