************************************************************************** * * * Project: MemorySearch * * Filename: mem.asm * Authors: Steve Moser, Markus Stegner * * ************************************************************************** * Description:************************************************************ * *Search a string in memory * ************************************************************************** * Addressmap with EQUates:************************************************ * RAM EQU $0 ;RAM section STACK EQU RAM+$800 ;Stack section PGM EQU RAM+$C00 ;Program start ROM EQU $800000 ;ROM section * *************************************************************************** * IN/OUT-Parameters:****************************************************** * * IN: none * OUT: none * ************************************************************************** * Definitions:************************************************************ * *** 68332 global registerdefinitions *** * * SIM SIMCR EQU $FFFA00 ;SIM Configuration Register SYPCR EQU $FFFA20 ;System Protection Register CSBARBT EQU $FFFA48 ;Chip Select Base Address Boot Register CSBAR0 EQU $FFFA4C ;Chip Select Base Address Register 0 *PORT E PEPAR EQU $FFFA16 ;Pin Assignment Register DDRE EQU $FFFA14 ;Data Direction Register PORTE EQU $FFFA12 ;Port E is decoded on 2 *PORT F PFPAR EQU $FFFA1E ;Pin Assignment Register DDRF EQU $FFFA1C ;Data Direction Register PORTF EQU $FFFA1A ;Port F is decoded on 2 * * Globals SL EQU 1024 ;Stack length MS EQU $FFFF ;konstante nach der gesucht werden soll * ************************************************************************** *** Init Presets ********************************************************* * *** Place FEPROM at $800000, because unused * ORG CSBARBT ;set on CSBARBT DC.W $8003 ;at 8M, size 64KB * *** Place ext. RAM at $0, 256KB, 0WS *** * ORG CSBAR0 ;Set on SIM CSs DC.W $0005 ;CSBAR0, ext. RAM_RD DC.W $6830 ;CSOR0 DC.W $0005 ;CSBAR1, ext. RAM_WR_LO DC.W $3030 ;CSOR1 DC.W $0005 ;CSBAR2, ext. RAM_WR_HI DC.W $5030 ;CSOR2 * *** Initialize SIM and system protection * Switch off watchdogs, also while FREEZE is active * ORG SIMCR DC.W $60CF ;FREEZE settings ORG SYPCR DC.W $0000 ;no system protection * *** Define Stack *** * ORG STACK ;Stackarea starts at $800 ST DS.B SL ;Length is 1KByte * ************************************************************************** * Program: *************************************************************** * *** Used processor-registers: * D0: konstante * *** Start in SRAM *** ORG PGM ;Programcode at $C00 * *** Initialize registers *** * * Initialize stack pointer BLINK MOVE.L #ST+SL,A7 ;load Stack Pointer * Initial Program Counter is initialized by the corresponding DO-File * *** mem: main ** * START MOVE.l #$0,A0 ;beginne ab der adresse #1000 MOVE.w (A0),D1 ;schiebe inhalt der adresse an a0 in d1 move.w #MS,D2 ;schiebe konstante MS nach D2 move.l #$0,D7 VGL CMP D1,D2 ;vgl D1 mit konstanten BEQ ADDIEREN ;wenn gefunden gehe zu ADDIEREN NEXT MOVE.w (A0)+,D1 ;zähle speicherbereich 2 weiter CMP.w #$00FF,A0 BEQ STOPPEN BRA VGL ;gehe zu VGL ADDIEREN ADD.w #1,D7 BRA NEXT STOPPEN BRA STOPPEN * *** For the Assembler... *** END MEM * **************************************************************************