comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 116:14a074e1a375

Split C code, and use direct linking.
author JeanDo
date Sun, 26 Dec 2010 14:30:13 +0100
parents 2a31948dbcb7
children 6a94f96e9cea
comparison
equal deleted inserted replaced
115:50a06adabc67 116:14a074e1a375
273 273
274 simulator_calc_deco_loop1: 274 simulator_calc_deco_loop1:
275 call divemode_check_decogases ; Checks for decogases and sets the gases 275 call divemode_check_decogases ; Checks for decogases and sets the gases
276 call divemode_prepare_flags_for_deco 276 call divemode_prepare_flags_for_deco
277 277
278 call deco_main_calc_hauptroutine ; calc_tissue 278 call deco_calc_hauptroutine ; calc_tissue
279 movlb b'00000001' ; rambank 1 selected 279 movlb b'00000001' ; rambank 1 selected
280 280
281 movff char_O_deco_status,deco_status ; 281 movff char_O_deco_status,deco_status ;
282 tstfsz deco_status ; deco_status=0 if decompression calculation done 282 tstfsz deco_status ; deco_status=0 if decompression calculation done
283 bra simulator_calc_deco_loop1 ; Not finished 283 bra simulator_calc_deco_loop1 ; Not finished
295 btg LED_red 295 btg LED_red
296 296
297 call divemode_check_decogases ; Checks for decogases and sets the gases 297 call divemode_check_decogases ; Checks for decogases and sets the gases
298 call divemode_prepare_flags_for_deco 298 call divemode_prepare_flags_for_deco
299 299
300 call deco_main_calc_hauptroutine ; calc_tissue 300 call deco_calc_hauptroutine ; calc_tissue
301 movlb b'00000001' ; rambank 1 selected 301 movlb b'00000001' ; rambank 1 selected
302 ostc_debug 'C' ; Sends debug-information to screen if debugmode active 302 ostc_debug 'C' ; Sends debug-information to screen if debugmode active
303 303
304 decfsz logbook_temp1,F 304 decfsz logbook_temp1,F
305 bra simulator_calc_deco_loop2 305 bra simulator_calc_deco_loop2
335 335
336 simulator_calc_deco2: 336 simulator_calc_deco2:
337 call divemode_check_decogases ; Checks for decogases and sets the gases 337 call divemode_check_decogases ; Checks for decogases and sets the gases
338 call divemode_prepare_flags_for_deco 338 call divemode_prepare_flags_for_deco
339 339
340 call deco_main_calc_hauptroutine ; calc_tissue 340 call deco_calc_hauptroutine ; calc_tissue
341 movlb b'00000001' ; rambank 1 selected 341 movlb b'00000001' ; rambank 1 selected
342 342
343 movff char_O_deco_status,deco_status ; 343 movff char_O_deco_status,deco_status ;
344 tstfsz deco_status ; deco_status=0 if decompression calculation done 344 tstfsz deco_status ; deco_status=0 if decompression calculation done
345 bra simulator_calc_deco2 ; Not finished 345 bra simulator_calc_deco2 ; Not finished
347 347
348 348
349 simulator_save_tissue_data: 349 simulator_save_tissue_data:
350 bsf restore_deco_data ; Set restore flag 350 bsf restore_deco_data ; Set restore flag
351 ostc_debug 'S' ; Sends debug-information to screen if debugmode active 351 ostc_debug 'S' ; Sends debug-information to screen if debugmode active
352 call main_push_tissues_to_vault 352 call deco_push_tissues_to_vault
353 movlb 0x01 ; Back to RAM Bank1 353 movlb 0x01 ; Back to RAM Bank1
354 ostc_debug 'T' ; Sends debug-information to screen if debugmode active 354 ostc_debug 'T' ; Sends debug-information to screen if debugmode active
355 return 355 return
356 356
357 simulator_restore_tissue_data: 357 simulator_restore_tissue_data:
358 bcf restore_deco_data ; clear restore flag 358 bcf restore_deco_data ; clear restore flag
359 ostc_debug 'S' ; Sends debug-information to screen if debugmode active 359 ostc_debug 'S' ; Sends debug-information to screen if debugmode active
360 call main_pull_tissues_from_vault 360 call deco_pull_tissues_from_vault
361 movlb 0x01 ; Back to RAM Bank1 361 movlb 0x01 ; Back to RAM Bank1
362 ostc_debug 'T' ; Sends debug-information to screen if debugmode active 362 ostc_debug 'T' ; Sends debug-information to screen if debugmode active
363 363
364 ostc_debug 'G' ; Sends debug-information to screen if debugmode active 364 ostc_debug 'G' ; Sends debug-information to screen if debugmode active
365 call deco_main_calc_desaturation_time ; calculate desaturation time 365 call deco_calc_desaturation_time ; calculate desaturation time
366 movlb b'00000001' ; select ram bank 1 366 movlb b'00000001' ; select ram bank 1
367 call calculate_noflytime ; Calc NoFly time 367 call calculate_noflytime ; Calc NoFly time
368 ostc_debug 'H' ; Sends debug-information to screen if debugmode active 368 ostc_debug 'H' ; Sends debug-information to screen if debugmode active
369 369
370 ; Calculate CNS 370 ; Calculate CNS
371 call main_calc_CNS_fraction ; calculate CNS 371 call deco_calc_CNS_fraction ; calculate CNS
372 movlb b'00000001' ; rambank 1 selected 372 movlb b'00000001' ; rambank 1 selected
373 return 373 return