News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

What is the error with ccz80/ccz80++:   Ld (hl), 90 & # 00FF

Started by cpcuser, 10:49, 14 November 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcuser


Hi good afternoon.


What is the error with ccz80:
Ld (hl), 90&#00FF


The error also occurs at ccz80 ++


When I create a bin file with the compiler, this runs error-free in the system.


thank you.


greeting

ervin

Please upload your source code so I can have a look at what you are trying to do.
I might be able to help.

cpcuser


At the ccz80 it often also before!

row :ld   (hl),32&#00FF

code with ccz80++ :


                                 ; Code generated by:
                                 ;   ccz80++ version 1.0.4
                                 ;   Cross compiler for Z80 with objects
                                 ;   © 2014 Emilio Guerrero
                                 ;   http://ccz80pp.webcindario.com/
                                 ; Created Montag, 14. November 2016, 12:30:49


                                 org  #8000
__begin_program:


                                 ; File Example1.ccz80


                                 ; main_0040 ( ) ;
                                 call _main_0040                       ; Call to function routine


                                 ; return ;
                                 ret


                                 ; main_0040_Code :
_main_0040_code:


                                 ; * ( ElementAddress ( - 1 ) ) = 32 ;
                                 ; Evaluate ElementAddress inline function parameter: - 1
                                 ld   hl,-1                            ; Get constant number -1
                                 ; Inline function: ElementAddress
                                 ld   de,(_functiondatareferencestore) ; Get current function data reference
                                 add  hl,de                            ; Add offset received
                                 ; End inline function: ElementAddress
                                 ; Optimization code:
                                 ; > push hl ; Store operation result *[function ElementAddress]
                                 ; > pop hl
                                 ; Replaced by:
                                 ; > nothing
                                 ; End optimization
                                 ld   (hl),32&#00FF


                                 ; while ( ( * ( ( ElementAddress ( - 1 ) ) ) ) )
__start_while_00000:
                                 ; Evaluate ElementAddress inline function parameter: - 1
                                 ld   hl,-1                            ; Get constant number -1
                                 ; Inline function: ElementAddress
                                 ld   de,(_functiondatareferencestore) ; Get current function data reference
                                 add  hl,de                            ; Add offset received
                                 ; End inline function: ElementAddress
                                 ; Optimization code:
                                 ; > push hl ; Store operation result *[function ElementAddress]
                                 ; > pop de
                                 ; > ld a,(de) ; Get byte pointer in stack
                                 ; Replaced by:
                                 ld   a,(hl)
                                 ; End optimization
                                 or   a                                ; Evaluate expression result
                                 jp   z,__end_while_00000              ; Jump when expression is false


                                 ; while sentences


                                 ; PrintChar_000x ( ( ( * ( ( ElementAddress ( - 1 ) ) ) ) ++ ) ) ;
                                 ; Evaluate PrintChar_000x inline function parameter: ( ( * ( ( ElementAddress ( - 1 ) ) ) ) ++ )
                                 ; Evaluate ElementAddress inline function parameter: - 1
                                 ld   hl,-1                            ; Get constant number -1
                                 ; Inline function: ElementAddress
                                 ld   de,(_functiondatareferencestore) ; Get current function data reference
                                 add  hl,de                            ; Add offset received
                                 ; End inline function: ElementAddress
                                 ; Optimization code:
                                 ; > push hl ; Store operation result *[function ElementAddress]
                                 ; > pop hl ; Get byte pointer in stack
                                 ; Replaced by:
                                 ; > nothing
                                 ; End optimization
                                 ld   a,(hl)
                                 inc  (hl)
                                 ; Optimization code:
                                 ; > push af ; Store operation result ++[byte pointer in stack]
                                 ; > pop af ; Get byte value in stack
                                 ; Replaced by:
                                 ; > nothing
                                 ; End optimization
                                 ; Inline function: PrintChar_000x
                                 call __txt_output
                                 ; End inline function: PrintChar_000x


                                 ; whileContinue_0064 :
_whilecontinue_0064:


                                 jp   __start_while_00000              ; Jump to while start
__end_while_00000:


                                 ; whileBreak_0065 :
_whilebreak_0065:


                                 ; SetInterruptions_001k ( ( ( function_0041_Address ( ) ) ) ) ;
                                 ; Evaluate SetInterruptions_001k inline function parameter: ( ( function_0041_Address ( ) ) )
                                 ; Inline function: function_0041_Address
                                 ld   hl,_function_0041
                                 ; End inline function: function_0041_Address
                                 ; Inline function: SetInterruptions_001k
                                 di   
                                 ld   de,(#0039)
                                 push de
                                 ld   (#0039),hl
                                 ei   
                                 ; End inline function: SetInterruptions_001k


                                 ; do


                                 ; do sentences
__start_do_00000:


                                 ; ReadKeys_003w ( ) ;
                                 call _readkeys_003w                   ; Call to function routine


                                 ; doContinue_0066 :
_docontinue_0066:


                                 ; while ( ( ( * GetKeys_003x ( ) ) == 65535 ) ) ;
                                 call _getkeys_003x                    ; Call to function routine
                                 ; Optimization code:
                                 ; > push hl ; Store operation result *[function GetKeys_003x]
                                 ; > pop hl
                                 ; Replaced by:
                                 ; > nothing
                                 ; End optimization
                                 ld   l,(hl)
                                 ld   h,0                              ; Get byte pointer in stack
                                 ld   bc,65535                         ; Get constant number 65535
                                 or   a
                                 sbc  hl,bc
                                 jp   z,__start_do_00000               ; Jump when expression is true


                                 ; doBreak_0067 :
_dobreak_0067:


                                 ; RestoreInterruptions_001l ( ) ;
                                 ; Inline function: RestoreInterruptions_001l
                                 di   
                                 pop  hl
                                 ld   (#0039),hl
                                 ei   
                                 ; End inline function: RestoreInterruptions_001l


                                 ; return ;
                                 ret


                                 ; End file Example1.ccz80


                                 ; Function function_0041()
_function_0041:
                                 di   
                                 push af
                                 push bc
                                 push hl
                                 ld   hl,(function_currentvalue)
                                 ld   b,0
function_loop:                   
                                 ld   a,(hl)
                                 rlca
                                 rlca
                                 rlca
                                 rlca
                                 ld   (hl),a
                                 inc  hl
                                 djnz function_loop
                                 ld   a,h
                                 or   l
                                 jr   nz,function_noend
                                 ld   hl,#C000
function_noend:                 
                                 ld   (function_currentvalue),hl
                                 pop  hl
                                 pop  bc
                                 pop  af
                                 ei   
                                 ret 
function_currentvalue:           
                                 defw #C000


                                 ; Function FunctionDataReferenceStore()
_functiondatareferencestore:
                                 defw 0                                ; Store for data reference of current function


                                 ; Function GetKeys_003x()
_getkeys_003x:
                                 ld   hl,gamekeyboard_getkeys_list
                                 ld   de,gamekeyboard_readkeys_keymap
                                 ld   bc,#0A00
gamekeyboard_getkeys_looplines: 
                                 ld   a,(de)
                                 push bc
                                 ld   b,8
gamekeyboard_getkeys_loopbits:   
                                 rrca
                                 jp   c,gamekeyboard_getkeys_notpressed
                                 ld   (hl),c
                                 inc  hl
gamekeyboard_getkeys_notpressed:
                                 inc  c
                                 djnz gamekeyboard_getkeys_loopbits
                                 inc  de
                                 pop  af
                                 ld   b,a
                                 djnz gamekeyboard_getkeys_looplines
                                 ld   (hl),-1
                                 ld   hl,gamekeyboard_getkeys_list
                                 ret 
gamekeyboard_getkeys_list:       
                                 defs 81


                                 ; Function main_0040()
_main_0040:
                                 ld   hl,(_functiondatareferencestore) ; Get previous function data address
                                 push hl                               ; Store data address of previous function
                                 ld   (_functiondatareferencestore),sp ; Set function data address for current function
                                 ld   hl,-1                            ; Function data size as negative
                                 add  hl,sp
                                 ld   sp,hl                            ; Reserve function data space
                                 call _main_0040_code                  ; Call code function
                                 ld   hl,(_functiondatareferencestore)
                                 ld   sp,hl                            ; Restore stack pointer previous to reserve space for function variables
                                 pop  hl
                                 ld   (_functiondatareferencestore),hl ; Restore data address for previous function
                                 ret 


                                 ; Function ReadKeys_003w()
_readkeys_003w:
gamekeyboard_readkeys_entry:     
                                 di   
                                 ld   hl,gamekeyboard_readkeys_keymap
                                 ld   bc,#F782
                                 out  (c),c
                                 ld   bc,#F40E
                                 ld   e,b
                                 out  (c),c
                                 ld   bc,#F6C0
                                 ld   d,b
                                 out  (c),c
                                 ld   c,0
                                 out  (c),c
                                 ld   bc,#F792
                                 out  (c),c
                                 ld   a,#40
                                 ld   c,#4A
gamekeyboard_readkeys_loop:     
                                 ld   b,d
                                 out  (c),a
                                 ld   b,e
                                 ini 
                                 inc  a
                                 cp   c
                                 jp   c,gamekeyboard_readkeys_loop
                                 ld   bc,#F782
                                 out  (c),c
                                 ei   
                                 ret 
gamekeyboard_readkeys_keymap:   
                                 defs 10


                                 ; Function Values_0001()
_values_0001:
__kl_choke_off:                  equ #BCC8
__kl_rom_walk:                   equ #BCCB
__kl_init_back:                  equ #BCCE
__kl_log_ext:                    equ #BCD1
__kl_find_command:               equ #BCD4
__kl_new_frame_fly:              equ #BCD7
__kl_add_frame_fly:              equ #BCDA
__kl_del_frame_fly:              equ #BCDD
__kl_new_fast_ticker:            equ #BCE0
__kl_add_fast_ticker:            equ #BCE3
__kl_del_fast_ticker:            equ #BCE6
__kl_add_ticker:                 equ #BCE9
__kl_del_ticker:                 equ #BCEC
__kl_init_event:                 equ #BCEF
__kl_event:                      equ #BCF2
__kl_sync_reset:                 equ #BCF5
__kl_del_synchronous:            equ #BCF8
__kl_next_sync:                  equ #BCFB
__kl_do_sync:                    equ #BCFE
__kl_done_sync:                  equ #BD01
__kl_event_disable:              equ #BD04
__kl_event_enable:               equ #BD07
__kl_disarm_event:               equ #BD0A
__kl_time_please:                equ #BD0D
__kl_time_set:                   equ #BD10
__reset_entry_rst_0:             equ #0000
__low_jump_rst_1:                equ #0008
__kl_low_pchl:                   equ #000B
__pcbc_instruction:              equ #000E
__side_call_rst_2:               equ #0010
__kl_side_pchl:                  equ #0013
__pcde_instruction:              equ #0016
__far_call_rst_3:                equ #0018
__kl_far_pchl:                   equ #001B
__pchl_instruction:              equ #001E
__ram_lam:                       equ #0020
__kl_far_call:                   equ #0023
__firm_jump_rst_5:               equ #0028
__user_restart_rst_6:            equ #0030
__interrupt_entry_rst_7:         equ #0038
__ext_interrupt:                 equ #003B
__kl_u_rom_enable:               equ #B900
__kl_u_rom_disable:              equ #B903
__kl_l_rom_enable:               equ #B906
__kl_l_rom_disable:              equ #B909
__kl_rom_restore:                equ #B90C
__kl_rom_select:                 equ #B90F
__kl_curr_selection:             equ #B912
__kl_probe_rom:                  equ #B915
__kl_rom_deselect:               equ #B918
__kl_ldir:                       equ #B91B
__kl_lddr:                       equ #B91E
__kl_poll_synchronous:           equ #B921
__kl_scan_needed:                equ #B92A
__km_initialise:                 equ #BB00
__km_reset:                      equ #BB03
__km_wait_char:                  equ #BB06
__km_read_char:                  equ #BB09
__km_char_return:                equ #BB0C
__km_set_expand:                 equ #BB0F
__km_get_expand:                 equ #BB12
__km_exp_buffer:                 equ #BB15
__km_wait_key:                   equ #BB18
__km_read_key:                   equ #BB1B
__km_test_key:                   equ #BB1E
__km_get_state:                  equ #BB21
__km_get_joystick:               equ #BB24
__km_set_translate:              equ #BB27
__km_get_translate:              equ #BB2A
__km_set_shift:                  equ #BB2D
__km_get_shift:                  equ #BB30
__km_set_control:                equ #BB33
__km_get_control:                equ #BB36
__km_set_repeat:                 equ #BB39
__km_get_repeat:                 equ #BB3C
__km_set_delay:                  equ #BB3F
__km_get_delay:                  equ #BB42
__km_arm_break:                  equ #BB45
__km_disarm_break:               equ #BB48
__km_break_event:                equ #BB4B
__txt_initialise:                equ #BB4E
__txt_reset:                     equ #BB51
__txt_vdu_enable:                equ #BB54
__txt_vdu_disable:               equ #BB57
__txt_output:                    equ #BB5A
__txt_wr_char:                   equ #BB5D
__txt_rd_char:                   equ #BB60
__txt_set_graphic:               equ #BB63
__txt_win_enable:                equ #BB66
__txt_get_window:                equ #BB69
__txt_clear_window:              equ #BB6C
__txt_set_column:                equ #BB6F
__txt_set_row:                   equ #BB72
__txt_set_cursor:                equ #BB75
__txt_get_cursor:                equ #BB78
__txt_cur_enable:                equ #BB7B
__txt_cur_disable:               equ #BB7E
__txt_cur_on:                    equ #BB81
__txt_cur_off:                   equ #BB84
__txt_validate:                  equ #BB87
__txt_place_cursor:              equ #BB8A
__txt_remove_cursor:             equ #BB8D
__txt_set_pen:                   equ #BB90
__txt_get_pen:                   equ #BB93
__txt_set_paper:                 equ #BB96
__txt_get_paper:                 equ #BB99
__txt_inverse:                   equ #BB9C
__txt_set_back:                  equ #BB9F
__txt_get_back:                  equ #BBA2
__txt_get_matrix:                equ #BBA5
__txt_set_matrix:                equ #BBA8
__txt_set_m_table:               equ #BBAB
__txt_get_m_table:               equ #BBAE
__txt_get_controls:              equ #BBB1
__txt_str_select:                equ #BBB4
__txt_swap_streams:              equ #BBB7
__gra_initialise:                equ #BBBA
__gra_reset:                     equ #BBBD
__gra_move_absolute:             equ #BBC0
__gra_move_relative:             equ #BBC3
__gra_ask_cursor:                equ #BBC6
__gra_set_origin:                equ #BBC9
__gra_get_origin:                equ #BBCC
__gra_win_width:                 equ #BBCF
__gra_win_height:                equ #BBD2
__gra_get_w_width:               equ #BBD5
__gra_get_w_height:              equ #BBD8
__gra_clear_window:              equ #BBDB
__gra_set_pen:                   equ #BBDE
__gra_get_pen:                   equ #BBE1
__gra_set_paper:                 equ #BBE4
__gra_get_paper:                 equ #BBE7
__gra_plot_absolute:             equ #BBEA
__gra_plot_relative:             equ #BBED
__gra_test_absolute:             equ #BBF0
__gra_test_relative:             equ #BBF3
__gra_line_absolute:             equ #BBF6
__gra_line_relative:             equ #BBF9
__gra_wr_char:                   equ #BBFC
__scr_initialise:                equ #BBFF
__scr_reset:                     equ #BC02
__scr_set_offset:                equ #BC05
__scr_set_base:                  equ #BC08
__scr_get_location:              equ #BC0B
__scr_set_mode:                  equ #BC0E
__scr_get_mode:                  equ #BC11
__scr_clear:                     equ #BC14
__scr_char_limits:               equ #BC17
__scr_char_position:             equ #BC1A
__scr_dot_position:              equ #BC1D
__scr_next_byte:                 equ #BC20
__scr_prev_byte:                 equ #BC23
__scr_next_line:                 equ #BC26
__scr_prev_line:                 equ #BC29
__scr_ink_encode:                equ #BC2C
__scr_ink_decode:                equ #BC2F
__scr_set_ink:                   equ #BC32
__scr_get_ink:                   equ #BC35
__scr_set_border:                equ #BC38
__scr_get_border:                equ #BC3B
__scr_set_flashing:              equ #BC3E
__scr_get_flashing:              equ #BC41
__scr_fill_box:                  equ #BC44
__scr_flood_box:                 equ #BC17
__scr_char_invert:               equ #BC4A
__scr_hw_roll:                   equ #BC4D
__scr_sw_roll:                   equ #BC50
__scr_unpack:                    equ #BC53
__scr_repack:                    equ #BC56
__scr_access:                    equ #BC59
__scr_pixels:                    equ #BC5C
__scr_horizontal:                equ #BC5F
__scr_vertical:                  equ #BC62
__cas_initialise:                equ #BC65
__cas_set_speed:                 equ #BC68
__cas_noisy:                     equ #BC6B
__cas_start_motor:               equ #BC6E
__cas_stop_motor:                equ #BC71
__cas_restore_motor:             equ #BC74
__cas_in_open:                   equ #BC77
__cas_in_close:                  equ #BC7A
__cas_in_abandon:                equ #BC7D
__cas_in_char:                   equ #BC80
__cas_in_direct:                 equ #BC83
__cas_return:                    equ #BC86
__cas_test_eof:                  equ #BC89
__cas_out_open:                  equ #BC8C
__cas_out_close:                 equ #BC8F
__cas_out_abandon:               equ #BC92
__cas_out_char:                  equ #BC95
__cas_out_direct:                equ #BC98
__cas_catalog:                   equ #BC9B
__cas_write:                     equ #BC9E
__cas_read:                      equ #BCA1
__cas_check:                     equ #BCA4
__bios_set_message:              equ #C033
__bios_setup_disc:               equ #C036
__bios_select_format:            equ #C039
__bios_read_sector:              equ #C03C
__bios_write_sector:             equ #C03F
__bios_format_track:             equ #C042
__bios_move_track:               equ #C045
__bios_get_status:               equ #C048
__bios_set_retry_count:          equ #C04B
__get_sector_data:               equ #C56C
__sound_reset:                   equ #BCA7
__sound_queue:                   equ #BCAA
__sound_check:                   equ #BCAD
__sound_arm_event:               equ #BCB0
__sound_release:                 equ #BCB3
__sound_hold:                    equ #BCB6
__sound_continue:                equ #BCB9
__sound_ampl_envelope:           equ #BCBC
__sound_tone_envelope:           equ #BCBF
__sound_a_address:               equ #BCC2
__sound_t_address:               equ #BCC5
__mc_boot_program:               equ #BD13
__mc_start_program:              equ #BD16
__mc_wait_flyback:               equ #BD19
__mc_set_mode:                   equ #BD1C
__mc_screen_offset:              equ #BD1F
__mc_clear_inks:                 equ #BD22
__mc_set_inks:                   equ #BD25
__mc_reset_printer:              equ #BD28
__mc_print_char:                 equ #BD2B
__mc_busy_printer:               equ #BD2E
__mc_send_printer:               equ #BD31
__mc_sound_register:             equ #BD34
__jump_restore:                  equ #BD37
__km_set_locks:                  equ #BD3A
__km_flush:                      equ #BD3D
__txt_ask_state:                 equ #BD40
__gra_default:                   equ #BD43
__gra_set_back:                  equ #BD46
__gra_set_first:                 equ #BD49
__gra_set_line_mask:             equ #BD4C
__gra_from_user:                 equ #BD4F
__gra_fill:                      equ #BD52
__scr_set_position:              equ #BD55
__mc_print_translation:          equ #BD58
__txt_draw_cursor:               equ #BDCD
__txt_undraw_cursor:             equ #BDD0
__txt_write_char:                equ #BDD3
__txt_unwrite:                   equ #BDD6
__txt_out_action:                equ #BDD9
__gra_plot:                      equ #BDDC
__gra_test:                      equ #BDDF
__gra_line:                      equ #BDE2
__scr_read:                      equ #BDE5
__scr_write:                     equ #BDE8
__scr_mode_clear:                equ #BDEB
__km_test_break:                 equ #BDEE
__mc_wait_printer:               equ #BDF1
__km_scan_keys:                  equ #BDF4
__move_real:                     equ #BD61
__integer_to_real:               equ #BD64
__binary_to_real:                equ #BD67
__real_to_integer:               equ #BD6A
__real_to_binary:                equ #BD6D
__real_fix:                      equ #BD70
__real_int:                      equ #BD73
__real_10a:                      equ #BD79
__real_addition:                 equ #BD7C
__real_reverse_subtraction:      equ #BD82
__real_multiplication:           equ #BD85
__real_division:                 equ #BD88
__real_comparison:               equ #BD8E
__real_unary_minus:              equ #BD91
__real_signum_sgn:               equ #BD94
__set_angle_mode:                equ #BD97
__real_pi:                       equ #BD9A
__real_sqr:                      equ #BD9D
__real_power:                    equ #BDA0
__real_log:                      equ #BDA3
__real_log_10:                   equ #BDA6
__real_exp:                      equ #BDA9
__real_sine:                     equ #BDAC
__real_cosine:                   equ #BDAF
__real_tangent:                  equ #BDB2
__real_arctangent:               equ #BDB5
__text_input:                    equ #BD5E
__real_rnd:                      equ #BD7F
__real_rnd_0:                    equ #BD8B


                                 ; Start free memory
__end_program:

cpcuser


fill screen with 129 , mode 2 :



include "cpc6128.ccz80";

word  scradr,i;

scradr=#c000;

mode(2);
cls();

for (i = 0; i <= #4000; ++i)
{
   scradr=scradr+1;
   *(scradr)=129;
}
return;



asm ccz80:


                            ; Code generated by:
                            ;   ccz80 version 3.1.5
                            ;   Cross compiler for Z80
                            ;   © 2012 Emilio Guerrero
                            ;   http://ccz80.webcindario.com/
                            ; Created Montag, 14. November 2016, 14:07:20


                            org  #8000
__begin_program:


                            ; File scrfill.ccz80


                            ; File D:\javacpc\pebi-ccz80\cpc6128.ccz80


                            ; File D:\javacpc\pebi-ccz80\standard.ccz80


                            ; End file D:\javacpc\pebi-ccz80\standard.ccz80


                            ; asm {
                            ; Firmware indirections
__kl_choke_off:             equ #BCC8
__kl_rom_walk:              equ #BCCB
__kl_init_back:             equ #BCCE
__kl_log_ext:               equ #BCD1
__kl_find_command:          equ #BCD4
__kl_new_frame_fly:         equ #BCD7
__kl_add_frame_fly:         equ #BCDA
__kl_del_frame_fly:         equ #BCDD
__kl_new_fast_ticker:       equ #BCE0
__kl_add_fast_ticker:       equ #BCE3
__kl_del_fast_ticker:       equ #BCE6
__kl_add_ticker:            equ #BCE9
__kl_del_ticker:            equ #BCEC
__kl_init_event:            equ #BCEF
__kl_event:                 equ #BCF2
__kl_sync_reset:            equ #BCF5
__kl_del_synchronous:       equ #BCF8
__kl_next_sync:             equ #BCFB
__kl_do_sync:               equ #BCFE
__kl_done_sync:             equ #BD01
__kl_event_disable:         equ #BD04
__kl_event_enable:          equ #BD07
__kl_disarm_event:          equ #BD0A
__kl_time_please:           equ #BD0D
__kl_time_set:              equ #BD10
__reset_entry_rst_0:        equ #0000
__low_jump_rst_1:           equ #0008
__kl_low_pchl:              equ #000B
__pcbc_instruction:         equ #000E
__side_call_rst_2:          equ #0010
__kl_side_pchl:             equ #0013
__pcde_instruction:         equ #0016
__far_call_rst_3:           equ #0018
__kl_far_pchl:              equ #001B
__pchl_instruction:         equ #001E
__ram_lam:                  equ #0020
__kl_far_call:              equ #0023
__firm_jump_rst_5:          equ #0028
__user_restart_rst_6:       equ #0030
__interrupt_entry_rst_7:    equ #0038
__ext_interrupt:            equ #003B
__kl_u_rom_enable:          equ #B900
__kl_u_rom_disable:         equ #B903
__kl_l_rom_enable:          equ #B906
__kl_l_rom_disable:         equ #B909
__kl_rom_restore:           equ #B90C
__kl_rom_select:            equ #B90F
__kl_curr_selection:        equ #B912
__kl_probe_rom:             equ #B915
__kl_rom_deselect:          equ #B918
__kl_ldir:                  equ #B91B
__kl_lddr:                  equ #B91E
__kl_poll_synchronous:      equ #B921
__kl_scan_needed:           equ #B92A
__km_initialise:            equ #BB00
__km_reset:                 equ #BB03
__km_wait_char:             equ #BB06
__km_read_char:             equ #BB09
__km_char_return:           equ #BB0C
__km_set_expand:            equ #BB0F
__km_get_expand:            equ #BB12
__km_exp_buffer:            equ #BB15
__km_wait_key:              equ #BB18
__km_read_key:              equ #BB1B
__km_test_key:              equ #BB1E
__km_get_state:             equ #BB21
__km_get_joystick:          equ #BB24
__km_set_translate:         equ #BB27
__km_get_translate:         equ #BB2A
__km_set_shift:             equ #BB2D
__km_get_shift:             equ #BB30
__km_set_control:           equ #BB33
__km_get_control:           equ #BB36
__km_set_repeat:            equ #BB39
__km_get_repeat:            equ #BB3C
__km_set_delay:             equ #BB3F
__km_get_delay:             equ #BB42
__km_arm_break:             equ #BB45
__km_disarm_break:          equ #BB48
__km_break_event:           equ #BB4B
__txt_initialise:           equ #BB4E
__txt_reset:                equ #BB51
__txt_vdu_enable:           equ #BB54
__txt_vdu_disable:          equ #BB57
__txt_output:               equ #BB5A
__txt_wr_char:              equ #BB5D
__txt_rd_char:              equ #BB60
__txt_set_graphic:          equ #BB63
__txt_win_enable:           equ #BB66
__txt_get_window:           equ #BB69
__txt_clear_window:         equ #BB6C
__txt_set_column:           equ #BB6F
__txt_set_row:              equ #BB72
__txt_set_cursor:           equ #BB75
__txt_get_cursor:           equ #BB78
__txt_cur_enable:           equ #BB7B
__txt_cur_disable:          equ #BB7E
__txt_cur_on:               equ #BB81
__txt_cur_off:              equ #BB84
__txt_validate:             equ #BB87
__txt_place_cursor:         equ #BB8A
__txt_remove_cursor:        equ #BB8D
__txt_set_pen:              equ #BB90
__txt_get_pen:              equ #BB93
__txt_set_paper:            equ #BB96
__txt_get_paper:            equ #BB99
__txt_inverse:              equ #BB9C
__txt_set_back:             equ #BB9F
__txt_get_back:             equ #BBA2
__txt_get_matrix:           equ #BBA5
__txt_set_matrix:           equ #BBA8
__txt_set_m_table:          equ #BBAB
__txt_get_m_table:          equ #BBAE
__txt_get_controls:         equ #BBB1
__txt_str_select:           equ #BBB4
__txt_swap_streams:         equ #BBB7
__gra_initialise:           equ #BBBA
__gra_reset:                equ #BBBD
__gra_move_absolute:        equ #BBC0
__gra_move_relative:        equ #BBC3
__gra_ask_cursor:           equ #BBC6
__gra_set_origin:           equ #BBC9
__gra_get_origin:           equ #BBCC
__gra_win_width:            equ #BBCF
__gra_win_height:           equ #BBD2
__gra_get_w_width:          equ #BBD5
__gra_get_w_height:         equ #BBD8
__gra_clear_window:         equ #BBDB
__gra_set_pen:              equ #BBDE
__gra_get_pen:              equ #BBE1
__gra_set_paper:            equ #BBE4
__gra_get_paper:            equ #BBE7
__gra_plot_absolute:        equ #BBEA
__gra_plot_relative:        equ #BBED
__gra_test_absolute:        equ #BBF0
__gra_test_relative:        equ #BBF3
__gra_line_absolute:        equ #BBF6
__gra_line_relative:        equ #BBF9
__gra_wr_char:              equ #BBFC
__scr_initialise:           equ #BBFF
__scr_reset:                equ #BC02
__scr_set_offset:           equ #BC05
__scr_set_base:             equ #BC08
__scr_get_location:         equ #BC0B
__scr_set_mode:             equ #BC0E
__scr_get_mode:             equ #BC11
__scr_clear:                equ #BC14
__scr_char_limits:          equ #BC17
__scr_char_position:        equ #BC1A
__scr_dot_position:         equ #BC1D
__scr_next_byte:            equ #BC20
__scr_prev_byte:            equ #BC23
__scr_next_line:            equ #BC26
__scr_prev_line:            equ #BC29
__scr_ink_encode:           equ #BC2C
__scr_ink_decode:           equ #BC2F
__scr_set_ink:              equ #BC32
__scr_get_ink:              equ #BC35
__scr_set_border:           equ #BC38
__scr_get_border:           equ #BC3B
__scr_set_flashing:         equ #BC3E
__scr_get_flashing:         equ #BC41
__scr_fill_box:             equ #BC44
__scr_flood_box:            equ #BC17
__scr_char_invert:          equ #BC4A
__scr_hw_roll:              equ #BC4D
__scr_sw_roll:              equ #BC50
__scr_unpack:               equ #BC53
__scr_repack:               equ #BC56
__scr_access:               equ #BC59
__scr_pixels:               equ #BC5C
__scr_horizontal:           equ #BC5F
__scr_vertical:             equ #BC62
__cas_initialise:           equ #BC65
__cas_set_speed:            equ #BC68
__cas_noisy:                equ #BC6B
__cas_start_motor:          equ #BC6E
__cas_stop_motor:           equ #BC71
__cas_restore_motor:        equ #BC74
__cas_in_open:              equ #BC77
__cas_in_close:             equ #BC7A
__cas_in_abandon:           equ #BC7D
__cas_in_char:              equ #BC80
__cas_in_direct:            equ #BC83
__cas_return:               equ #BC86
__cas_test_eof:             equ #BC89
__cas_out_open:             equ #BC8C
__cas_out_close:            equ #BC8F
__cas_out_abandon:          equ #BC92
__cas_out_char:             equ #BC95
__cas_out_direct:           equ #BC98
__cas_catalog:              equ #BC9B
__cas_write:                equ #BC9E
__cas_read:                 equ #BCA1
__cas_check:                equ #BCA4
__bios_set_message:         equ #C033
__bios_setup_disc:          equ #C036
__bios_select_format:       equ #C039
__bios_read_sector:         equ #C03C
__bios_write_sector:        equ #C03F
__bios_format_track:        equ #C042
__bios_move_track:          equ #C045
__bios_get_status:          equ #C048
__bios_set_retry_count:     equ #C04B
__get_sector_data:          equ #C56C
__sound_reset:              equ #BCA7
__sound_queue:              equ #BCAA
__sound_check:              equ #BCAD
__sound_arm_event:          equ #BCB0
__sound_release:            equ #BCB3
__sound_hold:               equ #BCB6
__sound_continue:           equ #BCB9
__sound_ampl_envelope:      equ #BCBC
__sound_tone_envelope:      equ #BCBF
__sound_a_address:          equ #BCC2
__sound_t_address:          equ #BCC5
__mc_boot_program:          equ #BD13
__mc_start_program:         equ #BD16
__mc_wait_flyback:          equ #BD19
__mc_set_mode:              equ #BD1C
__mc_screen_offset:         equ #BD1F
__mc_clear_inks:            equ #BD22
__mc_set_inks:              equ #BD25
__mc_reset_printer:         equ #BD28
__mc_print_char:            equ #BD2B
__mc_busy_printer:          equ #BD2E
__mc_send_printer:          equ #BD31
__mc_sound_register:        equ #BD34
__jump_restore:             equ #BD37
__km_set_locks:             equ #BD3A
__km_flush:                 equ #BD3D
__txt_ask_state:            equ #BD40
__gra_default:              equ #BD43
__gra_set_back:             equ #BD46
__gra_set_first:            equ #BD49
__gra_set_line_mask:        equ #BD4C
__gra_from_user:            equ #BD4F
__gra_fill:                 equ #BD52
__scr_set_position:         equ #BD55
__mc_print_translation:     equ #BD58
__txt_draw_cursor:          equ #BDCD
__txt_undraw_cursor:        equ #BDD0
__txt_write_char:           equ #BDD3
__txt_unwrite:              equ #BDD6
__txt_out_action:           equ #BDD9
__gra_plot:                 equ #BDDC
__gra_test:                 equ #BDDF
__gra_line:                 equ #BDE2
__scr_read:                 equ #BDE5
__scr_write:                equ #BDE8
__scr_mode_clear:           equ #BDEB
__km_test_break:            equ #BDEE
__mc_wait_printer:          equ #BDF1
__km_scan_keys:             equ #BDF4
__move_real:                equ #BD61
__integer_to_real:          equ #BD64
__binary_to_real:           equ #BD67
__real_to_integer:          equ #BD6A
__real_to_binary:           equ #BD6D
__real_fix:                 equ #BD70
__real_int:                 equ #BD73
__real_10a:                 equ #BD79
__real_addition:            equ #BD7C
__real_reverse_subtraction: equ #BD82
__real_multiplication:      equ #BD85
__real_division:            equ #BD88
__real_comparison:          equ #BD8E
__real_unary_minus:         equ #BD91
__real_signum_sgn:          equ #BD94
__set_angle_mode:           equ #BD97
__real_pi:                  equ #BD9A
__real_sqr:                 equ #BD9D
__real_power:               equ #BDA0
__real_log:                 equ #BDA3
__real_log_10:              equ #BDA6
__real_exp:                 equ #BDA9
__real_sine:                equ #BDAC
__real_cosine:              equ #BDAF
__real_tangent:             equ #BDB2
__real_arctangent:          equ #BDB5
__text_input:               equ #BD5E
__real_rnd:                 equ #BD7F
__real_rnd_0:               equ #BD8B


                            ; End file D:\javacpc\pebi-ccz80\cpc6128.ccz80


                            ; scradr = #c000 ;
                            ld   hl,49152          ; Get constant number #c000
                            ld   (_scradr),hl


                            ; mode ( 2 ) ;
                            ; Evaluate mode inline function parameter: 2
                            ld   a,2               ; Get constant number 2
                            ; Inline function: mode
                            call __scr_set_mode
                            ; End inline function: mode


                            ; cls ( ) ;
                            ; Inline function: cls
                            call __txt_clear_window
                            ; End inline function: cls


                            ; for ( i = 0 ; i <= #4000 ; ++ i )


                            ; for initialization
                            ld   hl,0              ; Get constant number 0
                            ld   (_i),hl
__start_for_00000:


                            ; for evaluation
                            ld   bc,(_i)           ; Get word variable i
                            ld   hl,16384          ; Get constant number #4000
                            or   a
                            sbc  hl,bc
                            jp   c,__end_for_00000 ; Jump when expression is false


                            ; for sentences


                            ; scradr = scradr + 1 ;
                            ld   hl,(_scradr)      ; Get word variable scradr
                            ; Optimization code:
                            ; > ld bc,1 ; Get constant number 1
                            ; > add hl,bc
                            ; Replaced by:
                            inc  hl
                            ; End optimization
                            ; Optimization code:
                            ; > push hl ; Store operation result [word variable scradr] + [constant number 1]
                            ; > pop hl ; Get word value in stack
                            ; Replaced by:
                            ; > nothing
                            ; End optimization
                            ld   (_scradr),hl


                            ; * ( scradr ) = 129 ;
                            ld   hl,(_scradr)      ; Get word variable scradr
                            ; Optimization code:
                            ; > push hl ; Store operation result *[word variable scradr]
                            ; > pop hl
                            ; Replaced by:
                            ; > nothing
                            ; End optimization
                            ld   (hl),129&#00FF


                            ; for setup
                            ld   hl,(_i)           ; Get word variable i
                            inc  hl
                            ld   (_i),hl


                            jp   __start_for_00000 ; Jump to for start
__end_for_00000:


                            ; return ;
                            ret


                            ; End file scrfill.ccz80


                            ; Variables declaration


_i:
                            defw 0
_scradr:
                            defw 0


                            ; Start free memory
__end_program:



Error : ld   (hl),129&#00FF


greeting

arnoldemu

@cpcuser : which assembler are you using?

Quote from: cpcuser on 10:49, 14 November 16
What is the error with ccz80:
Ld (hl), 90&#00FF

I guess the correct output is

ld (hl),90

the & and # will be dependent on assembler used.

And the use of #00ff implies 16-bit number.

LD (hl),nn

uses 8-bit number.

For pasmo this is correct syntax:


ld (hl),90 AND &00ff


For winape/maxam I think:


ld (hl),90 AND &00ff
or
ld (hl),90 AND &ff



My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

cpcuser


arnoldemu

Quote from: cpcuser on 16:44, 14 November 16
Assembler from JavaCpc.


Greeting
javacpc uses maxam syntax.

javacpc assembler is not compatible with the output from ccz80.

Replace & with AND
Replace # with &

You can use "devpac":

http://www.cpc-power.com/index.php?page=detail&num=4304
http://www.cpc-power.com/index.php?page=detail&num=4710

Documentation says:
http://cpcrulez.fr/zip/ccz80-language.pdf


"
The  syntax  for  write  the  assembler  code  in  functions  and  in  asm  statements  is  based  in  the GENA  assembler  of  DEVPAC  pack."
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource


Powered by SMFPacks Menu Editor Mod