Graphics

Graphics mode 9 demonstration
Effectus code ASM code Executable code

Graphics demonstration by w1k
Effectus code ASM code Executable code

Graphics mode 7 and parameter usage demonstration (drawing a triangle)
Effectus code ASM code Executable code

Fill routine demonstration
Effectus code ASM code Executable code

Butterfly by Michael Mitchell, provided to AtariAge by w1k
Effectus code ASM code Executable code


Arrays, sets, types, pointers

Demonstration of using array sets
Effectus code ASM code Executable code

Demonstration of using arrays for holding different types of values, such as numbers and strings
Effectus code ASM code Executable code

Demonstration of using arrays in loops (WHILE and FOR loop)
Effectus code ASM code Executable code

Demonstration of declaring type (struct) and its usage with variable
Effectus code ASM code Executable code

Demonstration od using records in array of custom type
Effectus code ASM code Executable code

Demonstration of using pointers using POINTER
Effectus code ASM code Executable code

BYTE ARRAY usage demonstration using direct memory assignment
Effectus code ASM code Executable code

CARD ARRAY usage demonstration using direct memory assignment
Effectus code ASM code Executable code


String manipulation

SCopy command demonstration
Effectus code ASM code Executable code

SCopyS command demonstration
Effectus code ASM code Executable code

SAssign command demonstration
Effectus code ASM code Executable code

String to number conversion using ValB, ValI and ValC commands
Effectus code ASM code Executable code

Number to string conversion using StrB, StrI and StrC commands
Effectus code ASM code Executable code

String input demonstration using InputS command
Effectus code ASM code Executable code

SCompare function demonstration
Effectus code ASM code Executable code


POKE and PEEK statement

Demonstration of using POKE statement
Effectus code ASM code Executable code

Demonstration of using PEEK statement
Effectus code ASM code Executable code


Branching/looping and conditional statements

IF / ELSE condition demonstration
Effectus code ASM code Executable code

FOR loop demonstration
Effectus code ASM code Executable code

WHILE loop demonstration
Effectus code ASM code Executable code

UNTIL loop demonstration
Effectus code ASM code Executable code

Demonstration od using DO OD loop
Effectus code ASM code Executable code

Demonstration of using EXIT command in loop statements
Effectus code ASM code Executable code

Loop effects by ascrnet
Effectus code ASM code Executable code

Demonstration of using IF statement with two conditions
Effectus code ASM code Executable code

ELSEIF example
Effectus code ASM code Executable code

Nested IF demonstration
Effectus code ASM code Executable code

IF condition demonstration using # (<>) operator
Effectus code ASM code Executable code

Demonstrating function execution in WHILE expression
Effectus code ASM code Executable code

Demonstrating function execution in IF and WHILE conditional expressions
Effectus code ASM code Executable code


PROCedures and FUNCtions

Demonstration of using local procedures
Effectus code ASM code Executable code

Demonstration of using local functions
Effectus code ASM code Executable code

Inline machine language usage in PROCedures
Effectus code ASM code Executable code

Inline machine language usage in FUNCtions
Effectus code ASM code Executable code

Calling OS routines
Effectus code ASM code Executable code


Arithmetic and bitwise operations

Arithmetics demonstration
Effectus code ASM code Executable code

Arithmetics demonstration of using operators MOD, ==+, ==-, ==*, and ==/
Effectus code ASM code Executable code

Demonstration of using logical (bitwise) operators
Effectus code ASM code Executable code


Printing characters on screen or other device

Demonstration of printing characters on screen
Effectus code ASM code Executable code

Demonstration of using PrintF command for printing formatted string on screen
Effectus code ASM code Executable code

Demonstration of printing characters on special device
Effectus code ASM code Executable code

Demonstration of printing text in graphics mode 2 (program by by ascrnet)
Effectus code ASM code Executable code


Disk input/output

Demonstration of reading characters one at a time from text file
Effectus code ASM code Executable code Disk image

Demonstration of reading lines of strings from text file
Effectus code ASM code Executable code Disk image


Misc

Sound demonstration
Effectus code ASM code Executable code

Joystick manipulation demonstration
Effectus code ASM code Executable code

Random number generator demonstration
Effectus code ASM code Executable code

Simple game using random number generator
Effectus code ASM code Executable code

INCLUDE demonstration (showing how to include library file to main program)
Effectus code ASM code Executable code

Custom user library as part of main program using INCLUDE statement
Effectus code

Keyboard device demonstration
Effectus code ASM code Executable code

Constants (DEFINE statement)
Effectus code ASM code Executable code

Using more than one operand in parameters
Effectus code ASM code Executable code

InputB, InputI and InputC function demonstration
Effectus code ASM code Executable code

Finescroll by greblus
Effectus code ASM code Executable code

ASCII demonstration
Effectus code ASM code Executable code



examples/code/func_asm.asm

Effectus code Mads code Executable code
 org $2200

 icl 'c:\atari\effectus\lib\common.asm'

 .var var19750412_eff_ .word
 .var X1_eff_ .byte
 .var NUM_eff_ .word

; CODE BLOCK WITH PARAMETERS EXAMPLE

TEST_reff_ .proc ( .byte a_reg, x_reg, y_reg, a3_par, a4_par, a5_par) .var
 mva a3_par $a3
 mva a4_par $a4
 mva a5_par $a5
 lda a_reg
 ldx x_reg
 ldy y_reg
; BACKGROUND COLOR
; BORDER COLOR
; CURSOR VISIBILITY
; CHARACTERS UPSIDE DOWN?
; COLUMN FOR TEXT
; ROW FOR TEXT
 .he 8E C6 02 8C C8 02 8D F0 02 A5 A5 8D F3 02 A5 A3 8D 55 00 00 00 A5 A4 8D 54 00 00 00  60
 rts

 .endp

ADD8_reff_ .proc ( .byte a, x) .reg
; CLD
; CLC
; STX $B1
; ADC $B1
; STA $A0
; RTS
 .he   D8  18 86 B1 65 B1 85 A0  60
 rts

 .endp

ADD16_reff_ .proc ( .word add1_eff_, add2_eff_) .var
 .var ADD1_eff_ .word
 .var ADD2_eff_ .word
 lda a_reg
 ldx x_reg
 ldy y_reg
 lda a_reg
 ldx x_reg
 lda ADD1_eff_
 pha
 ldx ADD1_eff_+1
 ldy ADD2_eff_
 mva ADD2_eff_+1 $A3
 pla
; CLD
; CLC
; STX $B1
; STY $B2
; ADC $B2
; STA $A0
; LDA $B1
; ADC $A3
; STA $A1
; RTS
 .he   D8  18 86 B1 84 B2 65 B2 85 A0 A5 B1 65 A3 85 A1  60
 rts

 .endp

MAIN_reff_


 Put #125
 TEST_reff_ #1, #20, #30, #8, #8, #4
 jsr printf
 dta c'LOOK, I AM UPSIDE DOWN!',$9b,0

 PutE
 PutE
 ADD8_reff_ #100, #50
 mva $A0 X1_eff_
 jsr printf
 dta c'ADD8(100,50) = ',0
 mva X1_eff_ $c0
 jsr printf
 dta c'%',$9b,0
 dta a($c0)

 ADD16_reff_ #1100, #34900
 mwa $A0 NUM_eff_
 jsr printf
 dta c'ADD16(1100,34900) = ',0
 jsr printf
 dta c'%',$9b,0
 dta a(NUM_eff_)

 jmp *

 .link 'c:\atari\effectus\lib\runtime.obx'
 .link 'c:\atari\effectus\lib\printf.obx'

 run MAIN_reff_