---------------------------------------------------------------------- Copyright (C) 1990 by Natrlich! This file is copyrighted! Refer to the documentation for details. ---------------------------------------------------------------------- NASM65 --- a Atari 8-Bit Crossassembler for the Atari ST (et al.) Preliminary manual for NASM65 libraries Copyright ½ 1990 by Natrlich! on sources, binaries and manuals ¯¯ Bang that Bit that doesn't Bang ®® I n t r o d u c t i o n The NASM65 system contains an at best rudimentary library of code, to be linked to your programs. The style in which these libraries are accessed is uniform and will be explained in this document. Refer also to the NLIB65, NLINK65 and STDIO documentation. A c c e s s i n g N A S M 6 5 l i b r a r i e s Libraries are accessed by the user in a uniform way, very much akin to C. The user includes a header file, like for example STDIO.H65. This files contains setup/call macros for functions that reside in libraries. The macros should be written in a generic sort of way, as exemplified in STDIO.H65. The point being that you can use the .MACROs in two ways Case 1: .include #system .include #stddef .include #macros .include #stdio ... OPEN 2,8,0,file PRINT 2,text,textend-text CLOSE 2 ... file: .byte "D:FOOBLE.BAR",0 text: .byte "Hello World",155,0 textend: Case 2: .include #system .include #stddef .include #macros .include #stdio ... OPEN channel,mode,0,filename,@p3 PRINT channel,text,textlen,0 CLOSE channel,@special ... channel: .ds 1 mode: .byte 8 text: .ds 128 textlen: .byte 128 In the first case, the macro is given values, whereas in the second case the macro is given addresses. With the help of an auxiliary parameter the user selects, which of the parameters are to be treated as adresses and which as values. (Default: No parameter -> all values, Parameter=0 -> all adresses) (Convention : parameter does not exist, all values are poked, parameter does exist : 0 = all values are addresses Libraries should always be called with a JSR from the outside not with a branch or JMP!! *** NOTE *** The setup macros are just for quick and dirty hacks, where you don't care about wasting some bytes for the sake of coding the stuff in maybe 10% of the time it would normally take you. If your writing something "for real" I'd suggest skipping the MACROS and calling the library directly.