-
+ C4EF1F09A367612089DE366E1D75F980928A48C40B2B30CB50FAE20439CA5FBF59AD0AA71AA231AA0AA75833BB71DE1F241A8A6F3FBD747A6BF91C17489A5D4C
m/devices/power.asm
(0 . 0)(1 . 58)
509 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
510 ;; ;;
511 ;; This file is part of 'M', a MIPS system emulator. ;;
512 ;; ;;
513 ;; (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) ;;
514 ;; http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html ;;
515 ;; ;;
516 ;; You do not have, nor can you ever acquire the right to use, copy or ;;
517 ;; distribute this software ; Should you use this software for any purpose, ;;
518 ;; or copy and distribute it to anyone or in any manner, you are breaking ;;
519 ;; the laws of whatever soi-disant jurisdiction, and you promise to ;;
520 ;; continue doing so for the indefinite future. In any case, please ;;
521 ;; always : read and understand any software ; verify any PGP signatures ;;
522 ;; that you use - for any purpose. ;;
523 ;; ;;
524 ;; See also http://trilema.com/2015/a-new-software-licensing-paradigm . ;;
525 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
526
527 ;; TODO: 'warm boot' command. Right now, 'shutdown' is the only supported cmd.
528
529 ;;;;;;;;;;;;;;;;;;;;;;;;;
530 ;; Power Supply Device ;;
531 ;;;;;;;;;;;;;;;;;;;;;;;;;
532
533 ;-----------------------------------------------------------------------------
534 ;; Power Supply:
535 DECLARE_BUS_DEVICE POWER, 0x410, 0x410
536 ;-----------------------------------------------------------------------------
537
538 ;-----------------------------------------------------------------------------
539 %define POWER_CMD_SHUTDOWN 0x01 ; 'Power off' immediately.
540 ;-----------------------------------------------------------------------------
541
542 ;-----------------------------------------------------------------------------
543 _PD_Read_Word_POWER: ; Word reads from POWER: always 0
544 xor eax, eax
545 ret ; Fin.
546 ;-----------------------------------------------------------------------------
547 _PD_Write_Word_POWER: ; Word writes to POWER do nothing!
548 ret
549 ;-----------------------------------------------------------------------------
550 _PD_Read_Byte_POWER:
551 xor eax, eax ; Read Byte from POWER: always 0
552 ret
553 ;-----------------------------------------------------------------------------
554 _PD_Write_Byte_POWER:
555 cmp dl, 1 ; 1 == shutdown
556 jne _PD_Write_Byte_POWER_No_Shutdown ; if != 1, do not shut down
557 Flg_On Shutdown ; Set the Shutdown flag.
558 _PD_Write_Byte_POWER_No_Shutdown:
559 ret ; Fin.
560 ;-----------------------------------------------------------------------------
561 _Device_Init_POWER: ; No init needed
562 ret
563 ;-----------------------------------------------------------------------------
564 _Device_Shutdown_POWER: ; Nothing needed
565 ret
566 ;-----------------------------------------------------------------------------