코어 워(Core War)는 D. G. 존스와 A. K. 듀드니가 개발한 1984년 프로그래밍 게임이다. 둘 이상의 배틀 프로그램들(일명 "워리어")이 가상 컴퓨터를 통제하기 위해 경쟁한다. 이들 배틀 프로그램들은 레드코드(Redcode)라는 이름의 추상화 어셈블리어로 개발되었다.

코어 워
플랫폼리눅스 위키데이터에서 편집하기
장르프로그래밍 게임 위키데이터에서 편집하기
모드일인용 비디오 게임 위키데이터에서 편집하기

레드코드 편집

레드코드는 코어 워에 사용된 프로그래밍 언어이다. MARS(Memory Array Redcode Simulator)라는 가상 머신에 의해 실행된다.

오리지널 8개 명령어는 아래와 같다.

OPcode  Mnemonic  Argument(s)                Action  
------- --------- ----- ----- ----------------------------------
  0       DAT            B   Initialize location to value B.
  1       MOV      A     B   Move A into location B.
  2       ADD      A     B   Add  operand  A  to   contents  of location  B  and  store  result in 
                                  location B.
  3       SUB      A     B   Subtract operand  A  from contents of location  B and store result in
                                  location B.                                      
  4       JMP            B   Jump to location B.
  5       JMZ      A     B   If operand A is  0, jump  to location  B;  otherwise  continue with
                                       next instruction.
  6       DJZ      A     B   Decrement contents  of  location A by 1.  If location  A now holds 0,
                                      jump  to   location  B;  otherwise continue with next instruction. 
  7       CMP      A     B   Compare operand  A with operand B. If they  are not  equal, skip next
                                       instruction;   otherwise  execute  next instruction.

외부 링크 편집