; Copyright 1998 Acorn Computers Ltd ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. ; AREA |ObjAsm$$Code|,CODE,READONLY XOS_Byte * &20006 OSByte_ReadCMOS * 161 CMOS_IPAddress0 * 108 CMOS_IPAddress1 * 109 CMOS_IPAddress2 * 110 CMOS_IPAddress3 * 0 XOS_SetVarVal * &20024 XOS_ConvertCardinal1 * &200D5 ENTRY ReadCMOSIP MOV R0,#OSByte_ReadCMOS MOV R1,#CMOS_IPAddress0 SWI XOS_Byte MOVVS PC,LR MOV R4,R2 MOV R1,#CMOS_IPAddress1 SWI XOS_Byte MOVVS PC,LR MOV R5,R2 MOV R1,#CMOS_IPAddress2 SWI XOS_Byte MOVVS PC,LR MOV R6,R2 MOV R1,#CMOS_IPAddress3 SWI XOS_Byte MOVVS PC,LR MOV R7,R2 ; If the address is 0.0.0.0 don't do anything ; If it's 0.0.0.x then treat as 10.0.0.x CMPS R4,#0 ; clears V TEQEQS R5,#0 TEQEQS R6,#0 MOVEQ R4,#10 TEQEQS R7,#0 MOVEQ PC,LR MOV R0,R4 MOV R1,R12 MOV R2,#512 SWI XOS_ConvertCardinal1 MOVVS PC,LR MOV R0,#"." STRB R0,[R1],#1 MOV R0,R5 SWI XOS_ConvertCardinal1 MOVVS PC,LR MOV R0,#"." STRB R0,[R1],#1 MOV R0,R6 SWI XOS_ConvertCardinal1 MOVVS PC,LR MOV R0,#"." STRB R0,[R1],#1 MOV R0,R7 SWI XOS_ConvertCardinal1 MOVVS PC,LR SUB R2,R1,R12 ADR R0,VarName MOV R1,R12 MOV R3,#0 MOV R4,#0 SWI XOS_SetVarVal MOV PC,LR VarName = "Inet$CMOSIPAddr", 0 = "ReadCMOSIP 1.01 (27 Apr 2000)" END