Annotation of nono/exp/pmove_anpi.has, revision 1.1.1.1

1.1       root        1: ; vi:set ts=8:
                      2: 
                      3: ; nono
                      4: ; Copyright (C) 2025 nono project
                      5: ;
                      6: ; Redistribution and use in source and binary forms, with or without
                      7: ; modification, are permitted provided that the following conditions
                      8: ; are met:
                      9: ; 1. Redistributions of source code must retain the above copyright
                     10: ;    notice, this list of conditions and the following disclaimer.
                     11: ; 2. Redistributions in binary form must reproduce the above copyright
                     12: ;    notice, this list of conditions and the following disclaimer in the
                     13: ;    documentation and/or other materials provided with the distribution.
                     14: ;
                     15: ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     16: ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     17: ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     18: ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     19: ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
                     20: ; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
                     21: ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
                     22: ; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
                     23: ; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     24: ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     25: ; SUCH DAMAGE.
                     26: 
                     27: ; Test whether undocumented PMOVE (An)+,TTn works or not.
                     28: ;
                     29: ; > has pmove_anpi.has
                     30: ; > hlk pmove_anpi.o
                     31: ; > pmove_anpi
                     32: 
                     33:        .include doscall.mac
                     34:        .include iocscall.mac
                     35:        .list
                     36:        .cpu    68030
                     37:        .text
                     38:        .even
                     39: 
                     40: start:
                     41:        clr.l   -(sp)
                     42:        DOS     _SUPER
                     43: 
                     44:        moveq.l #11,d1
                     45:        lea.l   fline_trap,a1
                     46:        IOCS    _B_INTVCS
                     47:        move.l  d0,backup_fline
                     48: 
                     49:        moveq.l #0,d0
                     50:        lea.l   @f,a3
                     51:        lea.l   dummy_tt,a0
                     52:        .dc.l   $f0180800       ; pmove (a0)+,tt0
                     53: @@:
                     54:        move.l  d0,-(sp)
                     55: 
                     56:        movea.l backup_fline,a1
                     57:        IOCS    _B_INTVCS
                     58: 
                     59:        move.l  (sp)+,d0
                     60:        beq     executed
                     61: got_trap:
                     62:        pea     msg_trap(pc)    ; expected
                     63:        DOS     _PRINT
                     64:        DOS     _EXIT
                     65: executed:
                     66:        pea     msg_exec(pc)    ; not expected
                     67:        DOS     _PRINT
                     68:        DOS     _EXIT
                     69: 
                     70: ; Fライン例外ハンドラ。
                     71: ; a3 に戻りアドレスをセットしてあること。
                     72: ; d0 を 1 にして帰る。
                     73: fline_trap:
                     74:        moveq.l #1,d0
                     75:        move.l  a3,2(sp)
                     76:        rte
                     77: 
                     78:        .data
                     79: dummy_tt:
                     80:        .dc.l   0
                     81: 
                     82: msg_trap:
                     83:        .dc.b   "F-line trap occured (Expected)",$d,$a,0
                     84: msg_exec:
                     85:        .dc.b   "No F-line trap occured (Not expected!)",$d,$a,0
                     86: 
                     87:        .bss
                     88:        .even
                     89: backup_fline:
                     90:        .ds.l   1
                     91: 
                     92:        .end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.