0% found this document useful (0 votes)
4 views1 page

Assembly Language Subroutine Example

This document is a user's guide for GW-BASIC that provides an example of placing an assembly language subroutine in a specified memory area. The example initializes variables, dimensions an array to hold the subroutine, uses POKE to load the assembly code into memory starting at the address of the first array element, and calls the subroutine, passing in three variables and printing the returned value.

Uploaded by

Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Assembly Language Subroutine Example

This document is a user's guide for GW-BASIC that provides an example of placing an assembly language subroutine in a specified memory area. The example initializes variables, dimensions an array to hold the subroutine, uses POKE to load the assembly code into memory starting at the address of the first array element, and calls the subroutine, passing in three variables and printing the returned value.

Uploaded by

Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

GW-BASIC User's Guide

Example 2 places the assembly language subroutine in the specified area:

Example 2
10 I=0:JC=0
100 DIM A%(23)
150 MEM%=VARPTR(A%(1))
200 FOR I=1 TO 23
300 READ JC
400 POKE MEM%,JC
450 MEM%=MEM%+1
500 NEXT
600 C1%=2:C2%=3:C3%=0
700 TWOSUM=VARPTR(A%(1))
800 CALL TWOSUM(C1%,C2%,C3%)
900 PRINT C3%
950 END
1000 DATA &H55,&H8b,&Hec &H8b,&H76,&H08,&H8b,&H04,&H8b,&H76
1100 DATA &H0a,&H03,&H04,&H8b,&H7e,&H06,&H89,&H05,&H5d
1200 DATA &Hca,&H06,&H00

[Link] (8 of 8)28/03/2004 21.29.05

You might also like