Jump to content
IGNORED

How to load Assembly routines with Atari Basic.


gs80065xe

Recommended Posts

A few examples:-

from disk file into string (first 6 bytes are file header, so throw them away)

this also prints the value on screen.

 

10000 DIM FILL$(30)
10010 OPEN #1,4,0,"D:FILL.OBJ"
10020 FOR I=1 TO 6:GET #1,A:NEXT I
10030 TRAP 10100:I=1
10040 GET #1,A:FILL$(I,I)=CHR$(A)
10050 I=I+1:? A;",";
10060 GOTO 10040
10100 CLOSE #1
One important point with strings in your listing is if the string contains the double quote character, something like
A$="123456"989009"
that quote in the middle will cause problems
you can get round this using;-
100 A$="HUy654sjdo":A$(len(A$)+1)=CHR$(34):A$(LEN(A$)+1)="sjdjsjh7w"
I tended to use USR routines to clear blocks of memory (for..loops take so long)
and things like VBL routines which obviously you can't do in BASIC
  • Like 2
Link to comment
Share on other sites

  • 4 years later...

you can also keep you binaries as load in snippets on the disk and load them in quite quickly and easily, compounded binaries as well... I figured there was similar question in the past, and I figure cross posting will help the searchers out.

Just enter this in, my first post did not appear as I wished so.

ENTER

image.thumb.png.706063c66cd043afdfbb91aea6933d65.png

there you go, load away, changing F$="filename.ext" in line 100 to whatever filename your binary is named.

Change POKE 5534,0 to 5534,192 in line 100     in order to LOAD and INIT but not RUN
USR is doing PLA, JMP $15A9 and that calls the DOS routine that dup.sys Menu option L. utilizes.

 

-----------------you can paste either of these into your emulator and then fix the paste up as noted-------------------------------

100 DIM F$(16):F$="D:BIN.OBJ":F$(LEN(F$)+1)=CHR$(155):POKE 5534,0:POKE 5535,192
110 X=ADR(F$):Y=INT(X/256):POKE 853,Y:POKE 852,X-256*Y:X=USR(ADR("hL) "))

 

100 DIM F$(16):F$="D:BIN.OBJ":F$(LEN(F$)+1)=CHR$(155):POKE 5534,0:POKE 5535,192
110 X=ADR(F$):Y=INT(X/256):POKE 853,Y:POKE 852,X-256*Y:X=USR(ADR("hL{inv}){inv}{^}U"))

 

The control characters are a pain in the ass on this forum so just press the inverse key (FUJIkey) where {inv} is so inverse shift 0 and then inverse again to turn that back off and then {^}  is Control U in the X=USR part of the basic code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...