Welcome, Guest. Please login or register.

Author Topic: Arghhh What is wrong with this asm code? (must be something stupid...)  (Read 4626 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Ok, I decided to go for some console text printing, just to test some control sequences and that... but I must be missing something very trivial cause the code gets an error in the very first instruction(bsr ini) wich I'm not getting what it is :lol:

Code: [Select]

execbase =4
openlib =-408
closelib =-414

open =-30
close =-36
write =-48
IoErr =-132
mode_old =1005
alloc_abs =-$cc

main:
     bsr init
     move.l conhandle,d1
     move.l testtext1,d2
     move.l #testtextend-testtext1,d3
     move.l dosbase,a6
     jsr write(a6)
     rts

init:
     move.l execbase,a6 ;open dos.library
     lea dosname(pc),a1
     moveq #0,d0
     jsr openlib(a6)
     move.l d0,dosbase
     beq error

     move.l dosbase,a6    ;open console
     move.l #mode_old,d2
     move.l consolename,d1
     jsr open(a6)
     move.l d0,conhandle
     beq error
     rts

  error: ;maybe later;)


dosname dc.b "dos.library",0,0
consolename dc.b 'con:0/100/640/100 TesttextWindow',0
            align 0,2

dosbase ds.l 1
conhandle ds.l 1

testtext1 dc.b 'This thing works dude!!!'
testtext2 dc.b $9b,'4;31;40m'
 dc.b 'underline'
 dc.b $9b,'3;33;40m',$9b,'5;20H'
 dc.b '** Hey Dammit !! **',0
testtextend


\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Hmm...I got the original source with the code indented...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Done :-)  But it's actually with square brackets not curly...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Thx all, I stand corrected. The error code for the initial code to stop if there's an error was going to be put but I gave up since it was just to fiddle around with it, nothing serious.

@Piru
You're a masochist :-D
\\"We made Amiga, they {bleep}ed it up\\"